﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DAplicaciones1;



namespace interfaz
{
    public partial class FormAgregados : Form
    {
        private Sistema sistema;
        private Item item;

        public FormAgregados(Item it)
        {
            InitializeComponent();
            sistema = Sistema.GetSistema();
            item = it;
        }

        private void btnFinalizar_Click(object sender, EventArgs e)
        {
            try
            {
                sistema.crearAgregados(item, txtAccesoOnline.Text, txtContenidoRelacionado.Text);
                lblErrores.Text = "";
                FormMenu menu = new FormMenu();
                menu.Show();
                this.Visible = false;
            }
            catch (Exception ex)
            {
                lblErrores.Text = ex.Message;
            }
        }

       
    }
}
